#ifndef IMAGETABWIDGET_H
#define IMAGETABWIDGET_H

#include <QTabWidget>
#include <QMap>
#include "Tools/ToolState.h"

class ImageViewWidget;

class ImageTabWidget : public QTabWidget
{
    Q_OBJECT

public:
    explicit ImageTabWidget(QWidget *parent = Q_NULLPTR);
    ~ImageTabWidget();

private:
    void initWidget();
    void connetSignalToSlots();

signals:
    void cursorPosChanged(QPoint& cursorpos);
    void imageAdded(int nID, const QString &imagename);
    void imageDeleted(int nID);
    void imageChanged(int nID);

public slots:
    void tabCloseSlot(int index);
    void tabChangeSlot(int index);
    void addImageViewWidget(const QString &imagename);

public:
    void updateImageViewWidget();
    void setEnCurToolState(const ToolState &enCurToolState);

private:
    int m_nCurWidgetID;
    ImageViewWidget* m_pCurImageViewWidget;

    int m_nMaxID;
    QMap<int, ImageViewWidget*>* m_pImageViewWidgetsMap;
};

#endif // IMAGETABWIDGET_H
